package org.soria.getinfo.panels;

import org.soria.getinfo.utils.InfoUtil;
import org.soria.getinfo.utils.PanelUtil;

import javax.swing.*;
import java.util.Map;

public class GPUPanel extends JPanel {
    public GPUPanel() {
        this.setLayout(null);
        this.setBorder(PanelUtil.createBorder("GPU信息"));
        Map<Integer,Map<String,String>> gpuInfo = InfoUtil.GPU;

        JLabel gpuNameLabel1 = PanelUtil.createLabel("GPU1名称：",15,30);
        this.add(gpuNameLabel1);
        JLabel gpuName1 = PanelUtil.createInfoLabel(gpuInfo.get(0).get("GPU_name"),115,30,300);
        this.add(gpuName1);
        JLabel gpuVendorLabel1 = PanelUtil.createLabel("GPU1厂商：",15,50);
        this.add(gpuVendorLabel1);
        JLabel gpuVendor1 = PanelUtil.createInfoLabel(gpuInfo.get(0).get("GPU_vendor"),115,50,300);
        this.add(gpuVendor1);
        JLabel gpuMemoryLabel1 = PanelUtil.createLabel("显存容量：",15,70);
        this.add(gpuMemoryLabel1);
        JLabel gpuMemory1 = PanelUtil.createInfoLabel(gpuInfo.get(0).get("GPU_VRAM"),115,70,300);
        this.add(gpuMemory1);
        JLabel gpuDriverLabel1 = PanelUtil.createLabel("驱动版本：",15,90);
        this.add(gpuDriverLabel1);
        JLabel gpuDriver1 = PanelUtil.createInfoLabel(gpuInfo.get(0).get("GPU_driver"),115,90,300);
        this.add(gpuDriver1);

        JLabel gpuNameLabel2 = PanelUtil.createLabel("GPU2名称：",485,30);
        this.add(gpuNameLabel2);
        JLabel gpuName2 = PanelUtil.createInfoLabel(gpuInfo.get(1).get("GPU_name"),585,30,350);
        this.add(gpuName2);
        JLabel gpuVendorLabel2 = PanelUtil.createLabel("GPU2厂商：",485,50);
        this.add(gpuVendorLabel2);
        JLabel gpuVendor2 = PanelUtil.createInfoLabel(gpuInfo.get(1).get("GPU_vendor"),585,50,300);
        this.add(gpuVendor2);
        JLabel gpuMemoryLabel2 = PanelUtil.createLabel("显存容量：",485,70);
        this.add(gpuMemoryLabel2);
        JLabel gpuMemory2 = PanelUtil.createInfoLabel(gpuInfo.get(1).get("GPU_VRAM"),585,70,300);
        this.add(gpuMemory2);
        JLabel gpuDriverLabel2 = PanelUtil.createLabel("驱动版本：",485,90);
        this.add(gpuDriverLabel2);
        JLabel gpuDriver2 = PanelUtil.createInfoLabel(gpuInfo.get(1).get("GPU_driver"),585,90,300);
        this.add(gpuDriver2);
    }
}
